# 杨辉三角列表生成器
def triangles():
    l = [1]
    t = [1]
    while True:
        yield l
        for i in range(1, len(l)+1):
            if i-1 >= 0 and i < len(l):
                t.append(l[i-1]+l[i])
            elif i == len(l):
                t.append(l[i-1])
        l = t
        t = [1]


n = 0
results = []
for t in triangles():
    print(t)
    results.append(t)
    n = n + 1
    if n == 10:
        break

